FROM openjdk:8-jre-slim
MAINTAINER weiyajun

VOLUME ["/data/applogs"]
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
EXPOSE 8080
ENV PORT 8080
ENV CLASSPATH /opt/lib
#ENV PARAMS="--spring.profiles.active=prod"
ENV PARAMS=""
ENV JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom  -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
ENV TZ=PRC
ARG SPRING_PROFILES_ACTIVE
ENV PROFILE_ACTIVE=${SPRING_PROFILES_ACTIVE}


ADD target/xxl-job-admin-*.jar /opt/app.jar

ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS /opt/app.jar $PARAMS --spring.profiles.active=$PROFILE_ACTIVE"]

